#!/bin/sh
processid=`ps -ef |grep tomcat-8.0.33_1|grep -v grep|grep -v tail |grep -v cronolog|awk '{print $2}'`
date=`date +%Y-%m-%d\ %H:%M:%S`

if [ -z "$processid" ];then
    echo "processid is empty"
    echo "$date restart tomcat8..." | xargs >> tomcat1_watchdog.log
    /home/qinyi/restart_tomcat_1.sh
else
    echo "$date processid is : $processid"
fi